<?php
namespace Project_725\Controller;

use Project_725\View\Frontend as View;
use Project_725\Model as Model;
use TwinPeaks\Core as Core;


class Index extends Core\CController
{
	/**
	 * @return CContext
	 */
	protected function getMainTplCtx()
	{
		return $this->getPageLayout()->getTemplateById(View\Layout::HEADER_TID)->getContext();
	}
	
	function frontend()
	{
        Model\Cohort::getById()->delete();
	}
	
	/**
	 * @return void
	 */
	function confirmEmail($code)
	{
		$user = Model\User::getByConfirmCode($code);
		if (!$user)
			return;
		$user->setConfirmCode('');
		$user->save();
		$this->redirect('/');
	}
}
